package com.gxa.web_admin.controller;

import com.gxa.common.vo.JsonResult;
import com.gxa.common.vo.R;
import com.gxa.modules.mapper.StartListMapper;
import com.gxa.modules.pojo.Start_List;
import com.gxa.modules.service.StartListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

/**
 * Created with IntelliJ IDEA.
 * User: zdk
 * Date: 2022/09/12 21:59
 * Description:
 * Version: V1.0
 */
@RestController
@RequestMapping("/start")

public class StartListController {

    @Autowired
    private StartListService startListService;

    @GetMapping("/findStartListMessage")
    public JsonResult findStartListMessage(Integer currentPage, Integer pageSize) {
        JsonResult j = startListService.findStartListMessage(currentPage, pageSize);
        return j;
    }

    @PostMapping("/delMessage")
    public R delMessage(Integer depart_id) {
        R r = startListService.delMessage(depart_id);
        return r;
    }

    @PostMapping("/updateStartMessage")
    public R updateStartMessage(Integer depart_id) {
        R r = startListService.updateStartMessage(depart_id);
        return r;
    }

    //装载
    @PostMapping("/findStartMessageByBeing")
    public JsonResult findStartMessageByBeing(Integer currentPage, Integer pageSize, Integer status) {
        JsonResult j = startListService.findStartMessageByBeing(currentPage, pageSize, status);
        return j;
    }

    //运货
    @PostMapping("/findStartMessageByUntreated")
    public JsonResult findStartMessageByUntreated(Integer currentPage, Integer pageSize, Integer status) {
        JsonResult j = startListService.findStartMessageByUntreated(currentPage, pageSize, status);
        return j;
    }

    //已完成
    @PostMapping("/findStartMessageByProcessed")
    public JsonResult findStartMessageByProcessed(Integer currentPage, Integer pageSize, Integer status) {
        JsonResult j = startListService.findStartMessageByProcessed(currentPage, pageSize, status);
        return j;
    }

    @PostMapping("/addStart")
    @ResponseBody
    public R addStart(@RequestBody Start_List start_list) {
        R r = startListService.addStart(start_list);
        return r;
    }
    @PostMapping("/findStartByOrder")
    public JsonResult findStartByOrder(@RequestBody HashMap map){
        JsonResult j = startListService.findStartByOrder(map);
        return  j;
    }
}